package com.active.api.impl;

import com.active.api.ActiveUserHandle;
import com.active.bean.ActiveUser;
import com.active.service.IActiveUserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ActiveUserHandleImpl implements ActiveUserHandle {

    private static final Logger logger = LoggerFactory.getLogger(ActiveUserHandleImpl.class);

    @Autowired
    private IActiveUserService activeUserService;

    @Override
    public ActiveUser getUserById(Integer id) {
        try {
            return activeUserService.getUserById(id);
        } catch (Exception e) {
            logger.error("查询active用户byid错误",e);
            return null;
        }
    }

    @Override
    public ActiveUser getUserByPassword(String name, String password) {
        try {
            return activeUserService.getUserByPassword(name,password);
        } catch (Exception e) {
            logger.error("查询active用户bypassword错误",e);
            return null;
        }
    }
}
